<div class="am-u-sm-12 am-u-md-3">
    <div class="am-form-group">
        <?php if (checkPrivilege('store.role/add')): ?>
            <div class="am-btn-group am-btn-group-xs">
                <a class="j-export am-btn am-btn-success am-radius"
                    href="javascript:void(0);">
                    <i class="iconfont icon-daochu am-margin-right-xs"></i>订单导出
                </a>
            </div>
        <?php endif; ?>
    </div>
</div>
<script>

    $(function () {

        /**
         * 订单导出
         */
        $('.j-export').click(function () {
            var data = {};
            var formData = $('#form-search').serializeArray();
            $.each(formData, function () {
                this.name !== 's' && (data[this.name] = this.value);
            });
            window.location = "/<{$routeUrl}>/export_csv" + '?' + $.urlEncode(data);
            // $.post("/<{$routeUrl}>/export", data, function (result) {
            //     // result.code === 1 ? $.show_success(result.msg, result.url)
            //     //     : $.show_error(result.msg);
            // });
        });

    });

</script>